package com.acminds.fotoporter.persistence.entities;

import java.io.Serializable;
import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the IMAGE database table.
 * 
 */
@Entity
@Table(name="IMAGE")
public class Image extends com.acminds.fotoporter.persistence.BaseDTO implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="IMAGE_ID")
	private int imageId;

	@Column(name="CREATE_DATE")
	private Timestamp createDate;

    @Lob()
	@Column(name="IMAGE_DATA")
	private byte[] imageData;

	@Column(name="IMAGE_DESC")
	private String imageDesc;

	@Column(name="IMAGE_EXTENSION")
	private String imageExtension;

	@Column(name="IMAGE_NAME")
	private String imageName;

	@Column(name="MIME_TYPE")
	private String mimeType;

	//bi-directional many-to-one association to Album
    @ManyToOne
	@JoinColumn(name="ALBUM_ID")
	private Album album;

	//bi-directional many-to-one association to Item
    @ManyToOne
	@JoinColumn(name="ITEM_ID")
	private Item item;

	//bi-directional many-to-one association to ItemOrdered
	@OneToMany(mappedBy="image")
	private List<ItemOrdered> itemOrdereds;

	//uni-directional many-to-one association to Advertisement
    @ManyToOne
	@JoinColumn(name="ADVERTISEMENT_ID")
	private Advertisement advertisement;

    public Image() {
    }

	public int getImageId() {
		return this.imageId;
	}

	public void setImageId(int imageId) {
		this.imageId = imageId;
	}

	public Timestamp getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Timestamp createDate) {
		this.createDate = createDate;
	}

	public byte[] getImageData() {
		return this.imageData;
	}

	public void setImageData(byte[] imageData) {
		this.imageData = imageData;
	}

	public String getImageDesc() {
		return this.imageDesc;
	}

	public void setImageDesc(String imageDesc) {
		this.imageDesc = imageDesc;
	}

	public String getImageExtension() {
		return this.imageExtension;
	}

	public void setImageExtension(String imageExtension) {
		this.imageExtension = imageExtension;
	}

	public String getImageName() {
		return this.imageName;
	}

	public void setImageName(String imageName) {
		this.imageName = imageName;
	}

	public String getMimeType() {
		return this.mimeType;
	}

	public void setMimeType(String mimeType) {
		this.mimeType = mimeType;
	}

	public Album getAlbum() {
		return this.album;
	}

	public void setAlbum(Album album) {
		this.album = album;
	}
	
	public Item getItem() {
		return this.item;
	}

	public void setItem(Item item) {
		this.item = item;
	}
	
	public List<ItemOrdered> getItemOrdereds() {
		return this.itemOrdereds;
	}

	public void setItemOrdereds(List<ItemOrdered> itemOrdereds) {
		this.itemOrdereds = itemOrdereds;
	}
	
	public Advertisement getAdvertisement() {
		return this.advertisement;
	}

	public void setAdvertisement(Advertisement advertisement) {
		this.advertisement = advertisement;
	}
	
}